<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<title>${fns:getConfig('productName')}-登录</title>
		<link rel="shortcut icon" href="favicon.ico" /> 
		<link href="${ctxStatic}/admin/skins/default/style.css" rel="stylesheet" type="text/css" >
		<script type="text/javascript" src="${ctxStatic}/scripts/jquery/jquery-1.11.2.min.js"></script>
		<script type="text/javascript" src="${ctxStatic}/scripts/jquery-validation/1.11.1/jquery.validate.min.js"></script>
		<script type="text/javascript">
			$(function() {
				//登录验证
				$("#loginForm").validate({
					rules: {
						username: "required",
						password: "required",
						validateCode: {required: true, remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"}
					},
					messages: {
						username: {required: "请填写账号."},
						password: {required: "请填写密码."},
						validateCode: { required: "请填写验证码.", remote: "验证码不正确."}
					},
					errorLabelContainer: "#login-tips",
					errorPlacement: function(error, element) {
						error.appendTo($("#msgtip"));
					}   
				});
				
				//检测IE
				if ('undefined' == typeof (document.body.style.maxHeight)) {
					window.location.href = 'ie6update.html';
				}
			});
		</script>
	</head>

	<body class="loginbody">
		<form method="post" action="${ctx}/login" id="loginForm">
			<div style="width: 100%; height: 100%; min-width: 300px; min-height: 260px;"></div>
			<div class="login-wrap">
				<div class="login-logo">LOGO</div>
				<div class="login-form">
					<div class="col">
						<input name="username" type="text" id="username" class="login-input" placeholder="管理员账号" title="管理员账号" value="gaoxin"> 
						<label class="icon user" for="username"></label>
					</div>
					<div class="col">
						<input name="password" type="password" id="password" class="login-input" placeholder="管理员密码" title="管理员密码" value="123456"> 
						<label class="icon pwd" for="password"></label>
					</div>
					<c:if test="${isValidateCodeLogin}">
					<div class="col">
						<sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>
					</div>
					</c:if>
					<div class="col">
						<input type="submit" name="btnSubmit" value="登 录" id="btnSubmit" class="login-btn">
					</div>
				</div>
				<div class="login-tips">
					<i></i>
					<p id="msgtip">${empty message ? '请输入用户名和密码' : message}</p>
				</div>
			</div>
	
			<div class="copy-right">
				<p>版权所有 广州小马信息科技有限公司 Copyright © 2009 - ${fns:getConfig('copyrightYear')} sharemarking.com Inc. All Rights Reserved.</p>
			</div>
		</form>
	</body>
</html>
